import Vue from 'vue'
import Vuex from 'vuex'
import MenuStore from './MenuStore'
import pointStore from './pointStore'
import AuthorStore from './AuthorStore'

Vue.use(Vuex)
export default new Vuex.Store({
  state: {
    historyLength: 0
  },
  mutations: {
    /*
     * @desc 记录路由切换次数
     * @arg {object} state 状态
     */
    updateHistoryLength (state) {
      state.historyLength++
    }
  },
  actions: {
    updateHistoryLength ({commit}) {
      commit('updateHistoryLength')
    }
  },
  modules: {
    MenuStore,
    pointStore,
    AuthorStore
  }
})
